//
//  TTCoreUI.h
//  Tint
//
//  Created by Kevin Wu on 2/22/12.
//  Copyright (c) 2012 Telligenty. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

/*
 * Autoresizing mask
 */
extern const NSUInteger TTViewAutoresizingKeepSize;
extern const NSUInteger TTViewAutoresizingKeepMargin;

/*
 * Animation duration constants
 */
extern const CGFloat TTTransitionDurationFast; // 0.2 seconds
extern const CGFloat TTTransitionDurationNormal; // 0.3 seconds
extern const CGFloat TTTransitionDurationSlow; // 0.4 seconds
extern const CGFloat TTTransitionDurationFlip; // 0.7 seconds

/*
 * Dimensions constants
 */
extern const CGFloat TTTableViewCellHeight; // 44.0 pixels

extern const CGFloat TTStatusBarHeight; // 20.0 pixels

extern const CGFloat TTToolbarHeightInPortrait; // 44.0 pixels
extern const CGFloat TTToolbarHeightInLandscape; // 32.0 pixels

extern const CGFloat TTNavigationBarHeightInPortrait; // 44.0 pixels
extern const CGFloat TTNavigationBarHeightInLandscape; // 32.0 pixels

extern const CGFloat TTKeyboardHeightInPortrait; // 216.0 pixels
extern const CGFloat TTKeyboardHeightInLandscape; // 160.0 pixels
extern const CGFloat TTPadKeyboardHeightInPortrait; // 264.0 pixels
extern const CGFloat TTPadKeyboardHeightInLandscape; // 352.0 pixels

/*
 * Orientation
 */
UIDeviceOrientation TTDeviceOrientation(void);
BOOL TTIsDevicePortrait(void);
BOOL TTIsDeviceLandscape(void);

UIInterfaceOrientation TTInterfaceOrientation(void);
BOOL TTIsInterfacePortrait(void);
BOOL TTIsInterfaceLandscape(void);

BOOL TTIsSupportedOrientation(UIInterfaceOrientation orientation);

CGAffineTransform TTRotateTransformForOrientation(UIInterfaceOrientation orientation);
CGAffineTransform TTSupportedRotateTransformForOrientation(UIInterfaceOrientation orientation);

CGFloat TTToolbarHeightForOrientation(UIInterfaceOrientation orientation);
CGFloat TTNavigationBarHeightForOrientation(UIInterfaceOrientation orientation);
CGFloat TTKeyboardHeightForOrientation(UIInterfaceOrientation orientation);

/*
 * Keyboard
 */
BOOL TTIsKeyboardVisible(void);
UIView *TTFindFirstResponderInView(UIView *topView);

/*
 * Debug
 */
void TTDumpSubviews(UIView *view, NSInteger level);
